﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;

using Weazel.Gezel.Model.Errors;

namespace Weazel.Gezel.Model.Test
{
  [TestClass]
  public class TestErrorMessage
  {
    [TestMethod]
    public void TestStringReferenceErrorMessageConstructor()
    {
      Position p = new Position("1", 1, 1, 1, "file");

      ErrorMessage e = new ErrorMessage("error at: ");
      e.AddPosition(p);
      e.AddString(" => ");
     
      Assert.AreEqual("error at: " + p.ToString() + " => ", e.ToString());
      Assert.AreEqual(3, e.Components.Count);

      Assert.IsTrue(e.Components[0] is string);
      Assert.IsTrue(e.Components[1] is Position);
      Assert.IsTrue(e.Components[2] is string);
    }
  }
}